

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link type="text/css" rel="stylesheet" href="${createLinkTo(dir:'css/csslxh',file:'lxh.css')}">
	<script type="text/javascript" src="../FCKeditor/fckeditor.js"></script> 
	<title>Create TechNote</title>         
</head>

<script language="javascript">
function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function doCheck()
{
	if(trim(document.getElementById("title").value) == '')
	{
    	alert('标题不能为空');
    	return false;		
	}
	if(trim(document.getElementById("ordernum").value) == '')
	{
    	alert('排序不能为空');
    	return false;		
	}
    var oEditor = FCKeditorAPI.GetInstance("content");  
    if( trim(oEditor.EditorDocument.body.innerText) == '' )
    {
    	alert('内容不能为空');
    	return false;
    }
}
</script>

<body style="margin:0; overflow:auto">

<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="${createLinkTo(dir:'imagesmain',file:'grayListBg.gif')}">
  <tr>       
	<td width="50%" style="padding-top:2px;padding-left:10px;padding-right:15px" nowrap>
		<img src="${createLinkTo(dir:'imageslxh',file:'post.gif')}">
		创建内容
	</td>
	<td>&nbsp;</td>		
  </tr>  
</table>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>

<g:hasErrors bean="${techNoteInstance}">
	<div class="errors">
		<g:renderErrors bean="${techNoteInstance}" as="list" />
	</div>
</g:hasErrors>

<g:form action="save" method="post" >
    <input type="hidden" name="flag" value="${flag}">
	<table width="800" align="center">
	  
	    <tr>
	    	<td> 
                <table width="100%" align="center">
                    <tbody>
                    
		                            <tr>
		                                <td>
		                                    <label for="title">标题:</label>
		                                    <input type="text" maxlength="100" size="50" id="title" name="title" value="${fieldValue(bean:techNoteInstance,field:'title')}" class="text999"/>
		                                </td>
		                            </tr> 

		        	                <tr>
		                                <td>
		                                    <label for="ordernum">排序:</label>
		                                    <input type="text" maxlength="10" id="ordernum" name="ordernum" value="${fieldValue(bean:techNoteInstance,field:'ordernum')}" class="text999"/>
		                                </td>
	                                </tr>                
		                            
		                            <tr>
		                                <td>
											<textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 300px"></textarea>
											<script type="text/javascript">
											var oFCKeditor = new FCKeditor('content') ;
											oFCKeditor.BasePath = "../FCKeditor/" ;
											oFCKeditor.Height = 300;
											oFCKeditor.ToolbarSet = "Lxhbar" ; //Default, Basic 
											oFCKeditor.ReplaceTextarea();
											</script> 		                                    
		                                </td>
		                            </tr>               
                    
                    </tbody>
                </table>
            </td>
        </tr>

	    <tr>
	    	<td align="right" style="padding-right:20px">
	    		<input type="submit" value="<g:message code='lxh.btn.save'/>" class="btnGray" onclick="return doCheck()">&nbsp;
	    		<input type="button" value="<g:message code='lxh.btn.cancel'/>" class="btnGray" onclick="history.back()">
	    	</td>
	    </tr>
	    
	</table>

</g:form>



</body>
</html>
